learning scripts

hi

i am very new to DOORS,i want to learn DXL scripting basics.can you send me some materials if you have otherwise send the link where i can get the complete details.pls make it as soon as possible.
thanks in advance.

regards,
bhuvana
bhuvanaperiyasamy - Tue Feb 01 04:35:24 EST 2011

Re: learning scripts
Mathias Mamsch - Tue Feb 01 05:14:12 EST 2011

See this post. If you have some more specific questions, feel free to ask. Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: learning scripts
bhuvanaperiyasamy - Tue Feb 01 05:49:56 EST 2011

hi

i read all the stuffs which are in edit DXL library,but still i couldnot understand the basics.I want to know the basics.can you please help me for that...

regards,
bhuvana

Re: learning scripts
SystemAdmin - Tue Feb 01 06:05:12 EST 2011

bhuvanaperiyasamy - Tue Feb 01 05:49:56 EST 2011
hi

i read all the stuffs which are in edit DXL library,but still i couldnot understand the basics.I want to know the basics.can you please help me for that...

regards,
bhuvana

Have you tried the DXL reference manual on the Help tab, in the introduction there are the basics of developing a program and language fundamentals with examples in the DXL library.

Re: learning scripts
bhuvanaperiyasamy - Tue Feb 01 06:21:44 EST 2011

I forgot to try it.thanks for your kind reply.

regards,
bhuvana

Re: learning scripts
David_G_Bond - Tue Feb 01 12:42:51 EST 2011

bhuvanaperiyasamy - Tue Feb 01 06:21:44 EST 2011
I forgot to try it.thanks for your kind reply.

regards,
bhuvana

It also helps to know something about the C++ programming language as dxl is based upon C++. Unfortunately dxl has some annoying differences from C++.

Re: learning scripts
SystemAdmin - Tue Feb 01 17:45:45 EST 2011

David_G_Bond - Tue Feb 01 12:42:51 EST 2011
It also helps to know something about the C++ programming language as dxl is based upon C++. Unfortunately dxl has some annoying differences from C++.

C++ ??

C++ is an object oriented language that can be compiled & linked into executable code.

DXL is a scripting language that is compiled & executed at run time and does not have a native object oriented structure - I wish that it did - and AFAIK it's closest cousin is the vanilla version of the "C" structural programming language.

Lets face it - just like "C", DXL is just plain old and wrinkled - but it can still be a bit of fun when a challenge arises.


Paul Miller
Melbourne, Australia

Re: learning scripts
Mathias Mamsch - Wed Feb 02 04:30:35 EST 2011

SystemAdmin - Tue Feb 01 17:45:45 EST 2011
C++ ??

C++ is an object oriented language that can be compiled & linked into executable code.

DXL is a scripting language that is compiled & executed at run time and does not have a native object oriented structure - I wish that it did - and AFAIK it's closest cousin is the vanilla version of the "C" structural programming language.

Lets face it - just like "C", DXL is just plain old and wrinkled - but it can still be a bit of fun when a challenge arises.


Paul Miller
Melbourne, Australia

It is so funny that the newest programming languages (like Scala) pick up on the readability aspects, that DXL implemented years ago (like leaving away braces on functions with one parameter or implicit declaration). In so far I would say that the idea of DXL was very modern. Unfortunately they did not consequently follow through and improve on the language.

Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: learning scripts
SystemAdmin - Wed Feb 02 09:50:01 EST 2011

SystemAdmin - Tue Feb 01 17:45:45 EST 2011
C++ ??

C++ is an object oriented language that can be compiled & linked into executable code.

DXL is a scripting language that is compiled & executed at run time and does not have a native object oriented structure - I wish that it did - and AFAIK it's closest cousin is the vanilla version of the "C" structural programming language.

Lets face it - just like "C", DXL is just plain old and wrinkled - but it can still be a bit of fun when a challenge arises.


Paul Miller
Melbourne, Australia

I agree with Paul Miller's assessment.

DXL is much more like C than C++. Anything that appears C++-like is more cosmetic rather than similar under the hood.

DXL did make certain operations more automatic such as dealing with strings. Native C does not have strings per se -- just arrays of characters. DXL made very easy to create strings but (unlike the other memory consuming DXL objects (e.g., Buffer, Skip)) they did not provide a way to release strings from memory after you are done. You need to close DOORS and restart to purge the string table so be aware of the string "memory-leak" effect in your designs.

Re: learning scripts
Mathias Mamsch - Wed Feb 02 11:32:54 EST 2011

SystemAdmin - Wed Feb 02 09:50:01 EST 2011
I agree with Paul Miller's assessment.

DXL is much more like C than C++. Anything that appears C++-like is more cosmetic rather than similar under the hood.

DXL did make certain operations more automatic such as dealing with strings. Native C does not have strings per se -- just arrays of characters. DXL made very easy to create strings but (unlike the other memory consuming DXL objects (e.g., Buffer, Skip)) they did not provide a way to release strings from memory after you are done. You need to close DOORS and restart to purge the string table so be aware of the string "memory-leak" effect in your designs.

There is no such thing as a "string table" in DOORS (see this post). All strings dynamically allocated from a DXL program are (under normal conditions) freed, when the DXL program ends. Each allocated memory is associated with the DXL context by the builtin perms. When the DXL program ends all memory of the DXL context is freed.

Try this code:

string s = "" 
 
ack "Check your memory before you start!"
 
// create strings with a memory footprint of (10000*9999)/2 = 50 MB
for i in 1:10000 do { s = s 'c' "" }
 
ack "Check your memory (should be about 50MB bigger) ..."

 


Watch the memory consumption in Task Manager. Notice how long it takes to release those 10000 strings! Memory management in DOORS seems to be extremely inefficient. My guess is, they keep the allocated memory blocks in an (skip) list, that is why programs get slower and slower. Because inserting an object in the skip list (when allocating a new string) gets slower and slower. And when freeing those lousy 10000 strings, DOORS probably deletes them from the list one by one making this a O(N²) operation in worst case.

So there must be other reasons (that I did not find yet), that memory is not released, my suspicion is that some perms (especially the ones with associated with richText or OLE objects) leak memory.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: learning scripts
SystemAdmin - Wed Feb 02 13:39:00 EST 2011

Mathias Mamsch - Wed Feb 02 11:32:54 EST 2011

There is no such thing as a "string table" in DOORS (see this post). All strings dynamically allocated from a DXL program are (under normal conditions) freed, when the DXL program ends. Each allocated memory is associated with the DXL context by the builtin perms. When the DXL program ends all memory of the DXL context is freed.

Try this code:

string s = "" 
 
ack "Check your memory before you start!"
 
// create strings with a memory footprint of (10000*9999)/2 = 50 MB
for i in 1:10000 do { s = s 'c' "" }
 
ack "Check your memory (should be about 50MB bigger) ..."

 


Watch the memory consumption in Task Manager. Notice how long it takes to release those 10000 strings! Memory management in DOORS seems to be extremely inefficient. My guess is, they keep the allocated memory blocks in an (skip) list, that is why programs get slower and slower. Because inserting an object in the skip list (when allocating a new string) gets slower and slower. And when freeing those lousy 10000 strings, DOORS probably deletes them from the list one by one making this a O(N²) operation in worst case.

So there must be other reasons (that I did not find yet), that memory is not released, my suspicion is that some perms (especially the ones with associated with richText or OLE objects) leak memory.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Thanks for the detailed clarification Mathias. I was blindly using terminology I saw in other posts without checking myself what was going on. Your experiments certainly support your conclusions.

That said, perhaps you can give some "between the lines" commentary on the below (IBM's response), namely:

 

PM10998: DOORS SHALL OPTIMIZE MEMORY MANAGMENT FOR USAGE OF STRINGS.
 
APAR status
     Closed as Permanent restriction.
Error description
     DOORS shall optimize memory managment for usage of Strings.
     
     At the moment memory is consumed and not released until the clie
     nt is restarted.
     
Local fix
     
Problem summary
     DOORS shall optimize memory managment for usage of Strings.
     
     At the moment memory is consumed and not released until the
     client is restarted.
     
Problem conclusion
     This APAR is being conceded as 'No plans to fix'. There are
     no current plans to change the current memory architecture
     of DOORS as this would require major rework.
     
Temporary fix
     
Comments
     
APAR Information
 
     APAR number  PM10998
     Reported component name TLOGIC DOORS
     Reported component ID 5724V61DR
     Reported release 830
     Status   CLOSED PRS
     PE NoPE
     HIPER   NoHIPER
     Special Attention  NoSpecatt
     Submitted date 2010-03-26
     Closed date  2010-06-15
     Last modified date 2010-06-15
     APAR is sysrouted FROM one or more of the following:
     APAR is sysrouted TO one or more of the following:
Fix information
Applicable component levels
 


Original link:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14478280&#14478280

Referenced in DXL Forum Link

https://www-304.ibm.com/support/docview.wss?mynp=OCSSYQBZ&mync=E&uid=swg1PM10998&myns=swgrat

COMMENT:
Re-interpreting what IBM said in light of what your findings, Mathias, IBM will not OPTIMIZE spent string removal from the heap upon DXL program exit.



 

Re: learning scripts
llandale - Wed Feb 02 16:29:50 EST 2011

Mathias Mamsch - Wed Feb 02 11:32:54 EST 2011

There is no such thing as a "string table" in DOORS (see this post). All strings dynamically allocated from a DXL program are (under normal conditions) freed, when the DXL program ends. Each allocated memory is associated with the DXL context by the builtin perms. When the DXL program ends all memory of the DXL context is freed.

Try this code:

string s = "" 
 
ack "Check your memory before you start!"
 
// create strings with a memory footprint of (10000*9999)/2 = 50 MB
for i in 1:10000 do { s = s 'c' "" }
 
ack "Check your memory (should be about 50MB bigger) ..."

 


Watch the memory consumption in Task Manager. Notice how long it takes to release those 10000 strings! Memory management in DOORS seems to be extremely inefficient. My guess is, they keep the allocated memory blocks in an (skip) list, that is why programs get slower and slower. Because inserting an object in the skip list (when allocating a new string) gets slower and slower. And when freeing those lousy 10000 strings, DOORS probably deletes them from the list one by one making this a O(N²) operation in worst case.

So there must be other reasons (that I did not find yet), that memory is not released, my suspicion is that some perms (especially the ones with associated with richText or OLE objects) leak memory.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Some years ago I wrote a program to demo the memory leak vis-a-vis how long certain operations took; the more string memory was used the slower DOORS got with operations that used the same size strings. Odd thing about this was that, always, somewhere in the test memory useage was drastically reduces AND executions times would drastically improve, only to get worse and worse again. So if I did the same thing 1000 times, 1st time was 1 second, 3rd time as 2 secons, 5th time was 3 secons, 7th time was 6 seconds, 10th time was down to 2 seconds, then increase. The one-time decrease was not consistent, somewhere betwen 5th and 10 test.

Anyway, I concluded there was indeed some sort of memory gathing thing going on but Telelogic knew nothing about it.

  • Louie

Reminds me of cars 10 years ago, where the Idle Air Control motor would reset itself one time per driving event, when cruising down the freeway. The car would stutter for a couple seconds and then resume cruising. Developers said it was the only practical way to make sure they knew exactly where the IAC motor was, something extremely imporant when you first start the car where they use a million criteria to figure out how much fuel and air to provide to a starting and newly idling engine. Anyway, they did it only once.